<?php $url = new Url();?>

<div id="main" class="">
    <div id="sidebar">
        <h3>Công việc tham gia</h3>
        <?php for($i=0;$i<count($data_task_user);$i++){                 
                ?>
                <a href="<?php echo $url->createUrl("task/detail",array("task_id"=>$data_task_user[$i]['task_id'])) ?>"><?php echo $data_task_user[$i]['task_name']; ?></a><br>
                <?php }  ?>
    </div>

    <div id="content">

        <div class="contextual"></div>

        <h2>Công việc</h2>
        <form action="" method="get" id="search_form">
            <div id="query_form_content" class="hide-when-print">
                <fieldset id="filters" class="collapsible ">
                    <legend>Bộ lọc</legend>
                    <div style="">
                        <table style="width:100%">
                            <tbody>
                                <tr>
                                    <td>
                                        <table id="filters-table">
                                            <tbody>
                                                <tr class="filter" id="tr_status_id">
                                                    <td class="field">
                                                        <input checked="checked" id="cb_status_id" name="" value="status_id" type="checkbox"><label for="cb_status_id"> Trạng thái</label>
                                                    </td>
                                                    <td class="values">
                                                        <span>
                                                            <select class="value" id="status_id" name="status_id" style="">
                                                                <option value="0">Tất cả</option>
                                                                <option value="1" <?php if($_GET['status_id']==1){echo "selected";} ?>>Mới</option>
                                                                <option value="2" <?php if($_GET['status_id']==2){echo "selected";} ?>>Đang thực hiện</option>
                                                                <option value="3" <?php if($_GET['status_id']==3){echo "selected";} ?>>Đã hoàn thành</option>
                                                            </select>                                                         
                                                        </span>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>                                
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </fieldset>            
            </div>
            <p class="buttons hide-when-print">
                <a class="icon icon-checked" href="javascript:" onclick="search_form()">Áp dụng</a>
                <a href="javascript:" class="icon icon-reload">Xóa</a>
            </p>
        </form>

        <div class="autoscroll">
            <table class="list issues">
                <thead>
                    <tr>                        
                        <th title="Sắp xếp theo &quot;#&quot;"><a href="javascript:">#</a></th>
                        <th title="Sắp xếp theo &quot;Dòng vấn đề&quot;"><a href="javascript:">Công việc</a></th>
                        <th title="Sắp xếp theo &quot;Trạng thái&quot;"><a href="javascript:">Trạng thái</a></th>
                        <th title="Sắp xếp theo &quot;Ưu tiên&quot;"><a href="javascript:">Ưu tiên</a></th>
                        <th title="Sắp xếp theo &quot;Chủ đề&quot;"><a href="javascript:">Danh mục</a></th>
                        <th title="Sắp xếp theo &quot;Gán cho&quot;"><a href="javascript:">Tiến độ</a></th>
                        <th title="Sắp xếp theo &quot;Cập nhật&quot;"><a href="javascript:">Cập nhật</a></th>
                    </tr>
                </thead>
                <tbody>
                    <?php for($i=0;$i<count($data);$i++){ ?>
                        <tr class="hascontextmenu <?php if(($i%2) == 1){echo "even";}else{echo "odd";} ?> issue status-2 priority-4">                        
                            <td class="id" style="text-align: center"><a href="<?php echo $url->createUrl("task/detail"); ?>"><?php echo $data[$i]['task_id']; ?></a></td>
                            <td class="subject"><a href="<?php echo $url->createUrl("task/detail",array("task_id"=>$data[$i]['task_id'])) ?>"><?php echo $data[$i]['task_name']; ?></a></td>
                            <td class="status" style="text-align: center"><?php switch($data[$i]['task_status']){ case 1:echo "Mới";break;case 2:echo "Đang thực hiện";break;case 3:echo "Đã hoàn thành";break;} ?></td>
                            <td class="priority" style="text-align: center"><?php switch($data[$i]['task_priority']){ case 1:echo "Thấp";break;case 2:echo "Bình thường";break;case 3:echo "Cao";break;} ?></td>
                            <td class="subject" style="text-align: center"><?php echo $data[$i]['category_name']; ?></td>                        
                            <td class="assigned_to" style="text-align: center"><?php echo $data[$i]['task_percent_done']; ?>%</td>
                            <td class="updated_on" style="text-align: center"><a href="javascript:"><?php echo date('d/m/Y H:i',$data[$i]['task_update_date']); ?></a></td>                                                
                        </tr>
                        <?php } ?>
                    <!--<tr id="issue-1362" class="hascontextmenu even issue status-3 priority-4">                        
                    <td class="id"><a href="javascript:">1362</a></td>
                    <td class="tracker">Bug</td>
                    <td class="status">Resolved</td>
                    <td class="priority">Normal</td>
                    <td class="subject"><a href="javascript:">Sửa form khai member sân (description)</a></td>
                    <td class="assigned_to"><a href="javascript:">amelie spieser</a></td>
                    <td class="updated_on">14-09-2012 10:39</td>
                    </tr>-->
                </tbody>
            </table>
        </div>        

        <div style="clear:both;"></div>
    </div>
</div>

<?php include "index.js.php"; ?>
